<%@ page contentType="text/html; charset=utf-8" language="java"
	import="java.sql.*" errorPage=""%>
<%@taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>blog</title>
		<style type="text/css">
<!--
body {
	background-image: url("image/background.jpg");
}
-->
</style>
	</head>

	<body>
		<div>
			您好：
			<s:property value="#session.user.name" />
			&nbsp;
			<a href="manage.action">管理博客</a>&nbsp;
			<a href="logout.action">退出</a>
			<div align="right">
				<form action="query.action" method="post">
					<input type="text" name="name">
						<select name="type">
							<option value="1">
								用户名
							</option>
							<option value="2">
								博文
							</option>
							<option value="3">
								相册
							</option>
						</select>
						<input type="submit" value="搜索">
				</form>
			</div>
		</div>

		<s:property value="#session.user.name"></s:property>
		的博客
		<div>
			<img src='<s:property value="#session.user.image"/>' height="50px"
				width="50px" />
		</div>
		<br />
		<div align="center">
			<a href="manage.action">首页</a>|
			<a href="checkArticles.action">日志</a> |
			<a href="checkAlbums.action">相册</a>|
			<a href="checkArticleClasses.action">个人中心</a>
		</div>
		<a href="addArticle.action">发博文</a>
		<div align="center">
			日志
			<br />

			<table border="1" width="300px;">
				<s:iterator value="#request.user.articles" begin="0" end="5">
					<tr>
						<td>
							<a
								href="checkArticleInfo.action?article.id=<s:property value="id"/>"><s:property
									value="title" /> </a>
							<br />
							<s:property value="content" />
						</td>
					</tr>
				</s:iterator>
				<s:if test="%{#request.user.articles.size==0}">
					<tr>
						<td>
							暂无日志
						</td>
					</tr>
				</s:if>
				<s:else>
					<tr>
						<td>
							<a href="checkArticles.action">查看全部</a>
						</td>
					</tr>
				</s:else>
			</table>
		</div>
		<div align="center" >
			留言
			<br />

			<table border="1" width="300px;">
				<s:iterator value="#request.user.messages" begin="0" end="5">
					<tr>
						<td>
							<s:property value="leaver.name" />
							<br />
							<s:property value="message" />
						</td>
					</tr>
				</s:iterator>
				<s:if test="%{#request.user.message.size==0}">
					<tr>
						<td>
							暂无留言
						</td>
					</tr>
				</s:if>
				<s:else>
					<tr>
						<td>
							<a href="checkMessages.action">查看全部</a>
						</td>
					</tr>
				</s:else>
			</table>
		</div>
	</body>
</html>